<template>
  <div class="child-page">
    <div> 儿子组件1 拥有书：{{ books }}</div>
    <div> 父组件房子：{{ house }}</div>
    <button @click="editData(5)">点击修改父组件的房子数量</button>
  </div>
</template>
<script setup lang="ts" name="privderAndInjectChild">
import { ref,inject } from 'vue';
const books = ref(5);

const {house,editData} = inject('send-house',{house:0,editData:(x:number)=>{}})

</script>
<style  scoped>
.child-page{
  padding: 20px 50px;
  background: green;
  color: #fff;
}
</style>
